package com.example.boot.webServices.cxf.config;

import javax.xml.ws.Endpoint;

import com.example.boot.webServices.cxf.service.impl.DemoWebServiceImpl;
import org.apache.cxf.Bus;
import org.apache.cxf.jaxws.EndpointImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * @author ruiwu
 * @version V1.0
 * @Description:Spring boot和cxf的整合。
 * 访问路径： http://localhost:8080/Service/demo?wsdl
 */
@Configuration
public class CxfConfig {
    @Autowired
    private Bus bus;
    @Bean
    public Endpoint endpoint() {
        EndpointImpl endpoint = new EndpointImpl(bus, new DemoWebServiceImpl());
        endpoint.publish("/demo");
        return endpoint;
    }
}
